package com.atguigu.springcloud.entities;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Json封装体
 * @author: XieHaichuan
 * @create: 2021-07-29 10:19
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CommonResult<T> {
    /**
     * 响应码
     */
    private Integer code;
    /**
     * 响应携带得信息
     */
    private String message;

    /**
     * 响应得数据
     */
    private T data;

    /**
     * 只有响应信息没有响应得数据得有参构造
     * @param code
     * @param message
     */
    public CommonResult(Integer code,String message){
        this.code = code;
        this.message = message;
    }

}
